<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head th:replace="common/form :: head"></head>
	<body class="mainbody">
		<form method="POST" th:object="${obj}">
			<div th:replace="common/form :: location('用户管理',*{id} gt 0 ?'修改用户信息':'新增用户')"></div>
			<div id="floatHead" class="content-tab-wrap">
			  <div class="content-tab">
			    <div class="content-tab-ul-wrap">
			      <ul>
			        <li><a href="javascript:;">用户信息</a></li>
			      </ul>
			    </div>
			  </div>
			</div>
			<div class="tab-content">
				<dl th:if="*{id} == 0">
					<dt>账号</dt>
				    <dd>
				      <input type="text" th:field="*{loginName}" class="input normal" data-type="*4-100" data-ajaxurl="checkLoginName" />
				      <span class="Validform_checktip">*账号至少4个字符</span>
				    </dd>
				</dl>
				<dl>
					<dt>姓名</dt>
				    <dd>
				      <input type="text" th:field="*{name}" class="input normal" data-type="*2-10" />
				      <span class="Validform_checktip">*姓名至少2个字符</span>
				    </dd>
				</dl>
				<dl th:if="*{id} == 0">
					<dt>密码</dt>
				    <dd>
				      <input type="password" th:field="*{password}" class="input normal" data-type="*5-15" />
				      <span class="Validform_checktip">*请输入5~15位密码</span>
				    </dd>
				</dl>
				<dl th:if="*{id} == 0">
					<dt>确认密码</dt>
				    <dd>
				      <input type="password" class="input normal" data-type="*" data-recheck="password" />
				      <span class="Validform_checktip">*重新输入密码</span>
				    </dd>
				</dl>
				<dl>
					<dt>手机号码</dt>
				    <dd>
				      <input type="text" th:field="*{mobile}" data-type="m" class="input normal" />
				      <span class="Validform_checktip">*请填写您的手机号码</span>
				    </dd>
				</dl>
				<dl>
					<dt>邮箱</dt>
				    <dd>
				      <input type="text" th:field="*{email}" data-type="e" class="input normal" />
				      <span class="Validform_checktip">*请填写邮箱地址</span>
				    </dd>
				</dl>
				<dl>
					<dt>可登录</dt>
				    <dd>
				    	<div class="rule-single-checkbox">
				    		<input type="checkbox" th:field="*{loginFlag}" />
				    	</div>
				    </dd>
				</dl>
				<dl>
					<dt>用户角色</dt>
				    <dd>
				    	<span class="rule-multi-porp">
				    		<th:block th:each="role,roleStat:${@roleService.allRoles}">
				    			<input type="checkbox" th:name="'roles['+${roleStat.count-1}+'].id'" th:value="${role.id}" th:checked="${obj.roles != null} and ${obj.roles.indexOf(role) gt -1}" />
				    			<label th:for="'roles['+${roleStat.count-1}+'].id'" th:text="${role.name}"></label>
				    		</th:block>
				    	</span>
				    </dd>
				</dl>
			</div>
			<div th:replace="common/form :: footer"></div>
		</form>
		<script type="text/javascript" th:replace="common/form :: formscript"></script>
	</body>
</html>